} );
};
- // Fire events from before track() triggred fire()
+ // Fire events from before track() triggered fire()
trackCallbacks.fire( mw.trackQueue );
/**
} else if ( contents instanceof this.Cdata ) {
// CDATA
if ( /<\/[a-zA-z]/.test( contents.value ) ) {
- throw new Error( 'mw.html.element: Illegal end tag found in CDATA' );
+ throw new Error( 'Illegal end tag found in CDATA' );
}
s += contents.value;
} else {
- throw new Error( 'mw.html.element: Invalid type of contents' );
+ throw new Error( 'Invalid type of contents' );
}
}
s += '</' + name + '>';
function queueModuleScript( src, moduleName, callback ) {
pendingRequests.push( function () {
// Keep in sync with execute()/runScript().
- if ( moduleName !== 'jquery' && hasOwn.call( registry, moduleName ) ) {
+ if ( moduleName !== 'jquery' ) {
window.require = mw.loader.require;
window.module = registry[ moduleName ].module;
}
var key, value, media, i, urls, cssHandle, siteDeps, siteDepErr, runScript,
cssPending = 0;
- if ( !hasOwn.call( registry, module ) ) {
- throw new Error( 'Module has not been registered yet: ' + module );
- }
if ( registry[ module ].state !== 'loaded' ) {
throw new Error( 'Module in state "' + registry[ module ].state + '" may not be executed: ' + module );
}
/**
* Change the state of one or more modules.
*
- * @param {Object} modules Object of module name/state pairs
+ * @param {Object} states Object of module name/state pairs
*/
- state: function ( modules ) {
+ state: function ( states ) {
var module, state;
- for ( module in modules ) {
- state = modules[ module ];
+ for ( module in states ) {
+ state = states[ module ];
if ( !hasOwn.call( registry, module ) ) {
mw.loader.register( module );
}